﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="active_WithMe_admin_index" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>管理后台</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />
</head>
<body>
<form id="form1" runat="server">
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">Admin</a></h1>
      <!-- Logo (221px wide) -->
      <a href="index.aspx"><img id="logo" src="resources/images/logo.png" alt="Admin" /></a>
      <!-- Sidebar Profile links -->
      <div id="profile-links"> Hello, <a href="#" title="Edit your profile"><%=Session["user"].ToString() %></a>, welcome to  Admin <br />
        <br />
        <a href="../index.aspx" target="_blank" title="View the Site">View the Site</a> | <a href="#" runat="server" onserverclick="SignOut" title="Sign Out">Sign Out</a> </div>
      <ul id="main-nav">
        <!-- Accordion Menu -->
        <li> <a href="index.aspx" class="nav-top-item current">
          <!-- Add the class "no-submenu" to menu items with no sub menu -->
          活动 </a> </li>

       
      </ul>
      <!-- End #main-nav -->
 
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    <noscript>
    <!-- Show a notification if the user has disabled javascript -->
    <div class="notification error png_bg">
      <div> Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
        Download From <a href="http://www.exet.tk">exet.tk</a></div>
    </div>
    </noscript>
    <!-- Page Head -->

    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>活动房间设置</h3>
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab current" onclick="Defaule();" id="gototab1">游览</a></li>
          <!-- href must be unique and match the id of target div -->
          <li><a href="#tab2" id="gototab2" onclick="Style();" >添加</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab " id="tab1">
          <!-- This is the target div. id must match the href of this div's tab -->
         <%if(message=="error"){ %>
          <div class="notification attention png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" onclick="Close();" /></a>
            <div> 抱歉，更新失败，请重新尝试！</div>
          </div>
          <%}
            else if (message == "success")
            { %>
          <div class="notification success png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" onclick="Close();" /></a>
      <div> 更新成功哦! </div>
        </div>
          <%}
            else if (message == "NoComplete")
            { %>    
            <div class="notification attention png_bg" id="note"> <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" onclick="Close();" /></a>
            <div>更新失败，请输入完整！</div>
          </div>
            <%} %>  
          <table>
            <thead>
              <tr>
         
            	<th>舞种</th>
				<th>老师</th>
				<th>活动时间</th>
				<th>操作</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="bulk-actions align-left">
               
                   </div>
                  <div class="pagination">  </div>
                  <!-- End .pagination -->
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody id="tab">
            	  <% 
                      if (xnl != null)
                      {
                         
                          foreach (System.Xml.XmlNode xnf in xnl)
                          { 
                              %>
			
         
              <tr >
     
                <td><%= xnf.Attributes["dance"].Value%></td>
                <td><%=  xnf.Attributes["teacher"].Value%></td>
                <td><%=xnf.Attributes["time"].Value%></td>
                <td>
                  <!-- Icons -->
                  <a href="#" title="Edit"><img src="resources/images/icons/pencil.png" alt="修改" onclick="edit('<%= xnf.Attributes["dance"].Value%>','<%=  xnf.Attributes["teacher"].Value%>','<%=xnf.Attributes["time"].Value%>','<%=xnf.Attributes["name"].Value%>');" /></a> <a href="#" onclick="if(confirm('确认删除吗？')){location.href='index.aspx?delete=yes&id=<%=xnf.Attributes["name"].Value%>';
}"   title="Delete"><img src="resources/images/icons/cross.png" alt="删除" /></a> <a href="#" title="Edit Meta" onclick="add();"><img src="resources/images/icons/hammer_screwdriver.png" alt="添加"  /></a> </td>
              </tr>
              
              <%}
            }%>
             
       
          
           
            </tbody>
          </table>
        </div>
        <!-- End #tab1 -->
        <div class="tab-content" id="tab2">
            <fieldset>
            <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
            <p>
              <label>舞种</label>
              <input class="text-input small-input" type="text" id="date-input"   name="date-input" />
             <!-- <span class="input-notification success png_bg">Successful message</span>-->
              <!-- Classes for input-notification: success, error, information, attention -->
              <br />
              <small>如:踢踏舞</small> </p>
            <p>
              <label>老师</label>
              <input class="text-input medium-input datepicker" type="text" id="roomid-input" name="roomid-input" />
             <!-- <span class="input-notification error png_bg">Error message</span> </p>-->
                <br />
              <small>如:王老师</small> </p>
            <p>
              <label>时间</label>
              <input class="text-input large-input" type="text" id="time-input" name="time-input" />
            </p>
         
            <p>
              <input type="hidden" id="name" name="name" value="" /> 
              <input class="button" type="button" value="提交" runat="server" onserverclick="EditContent"/>
            </p>
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
   

    <div id="footer"> <small>
      <!-- Remove this notice or replace it with whatever you want -->
      &#169; Copyright 2011 9158.Com | Powered by <a href="http://www.9158.com" target="_blank">9158.Com</a> | <a href="#">Top</a> </small> </div>
    <!-- End #footer -->
  </div>
  <!-- End #main-content -->
</div>
</form>
</body>
<script type="text/javascript">
    
   document.getElementById("tab2").style.display="none";
   var table=document.getElementById("tab");
       for(i=0;i<table.rows.length;i++)
       {
       if(i%2==0)
        {
            table.rows[i].className="alt-row";
            
         
        }       
       }     
  
    function edit(date,roomid,time,name)
    {
        Style();
       document.getElementById("gototab2").innerText="修改";
         document.getElementById("name").value=name;
       document.getElementById("date-input").value=date;
       document.getElementById("roomid-input").value=roomid;
       document.getElementById("time-input").value=time;

    }
    function add()
    {
       Style();
       document.getElementById("gototab2").innerText="添加";
       document.getElementById("name").value=""; 
      document.getElementById("date-input").value="";
       document.getElementById("roomid-input").value="";
       document.getElementById("time-input").value="";   
    }
    
    function Style()
    {
      document.getElementById("tab1").style.display="none";
       document.getElementById("tab2").style.display="block";   
        document.getElementById("gototab1").className="default-tab";
       document.getElementById("gototab2").className="current";
    }
    
    function Defaule()
    { 
       document.getElementById("gototab2").innerText="添加";
       document.getElementById("tab2").style.display="none";
       document.getElementById("tab1").style.display="block";   
       document.getElementById("gototab2").className="default-tab";
       document.getElementById("gototab1").className="current";
       document.getElementById("name").value=""; 
      document.getElementById("date-input").value="";
       document.getElementById("roomid-input").value="";
       document.getElementById("time-input").value="";  

    }
    function Close()
    {
       document.getElementById("note").style.display="none";
    
    }

</script>
</html>
